package com.nage.input;

import com.nage.multiplayer.MultiplayerSystem;

public class Input {

	public static final int TOUCH = 2;
	public byte owner = MultiplayerSystem.DEFAULT;
		
	public float x, y; // the current position of the finger on the screen
	public boolean updated, changed; // has the input been updated, and has the update changed the values?
	public long time; // the time this input was created.
	public float xDown, yDown; // the x/y values of where the finger was first touched down.
	public float xVector, yVector; // the distance in the x/y direction that the finger has moved since
									// since it was first touched, until current position.
	public float xAngle, yAngle; // represents the amount that the phone is tipped with x and y as the axis of rotation
								// xAngle +ve = top of phone pointing down. -ve = top of phone pointing up
								// yAngle +ve = right of phone point down. -ve = right of phone pointing up.
								// vaues betwee -10 and +10.

	public boolean downEvent; 
	
	@Override
	public String toString() {
		return " owner: "+owner+", x: "+x+", y: "+y
		+", updated: "+updated+", time: "+time+", xDown: "+xDown
		+", yDown: "+yDown+", xVector: "+xVector+", yVector: "+yVector;
	}

	public void setX(float f) {
		if(!changed) {
			changed = f != x; // if the new value of x is different to old, changed = true;
		}		
		x = f;
	}
	
	public void setY(float f) {
		if(!changed) {
			changed = f != y; // if the new value of y is different to old, changed = true;
		}
		y = f;
	}

	
}
